<!--- ==================================================
CURRENT VERSION:	2.0
DESC:  This tag is used to find all specific tax information
NOTE: Maintain lowwercase on all XML tags... Convert all other attributes to uppercase for Max.  Email should be in lowercase...
USE OF TAG:
	-Context of descriptsion:
		o- = optional  x- = required
		{}=Example  ---  [Web Description: Comments reflect unisys]  ---  (use within max accordance with max dcs blue screens|BR: (Business Rule))
INPUT PARAMS:
	<cf_xti_getshiptax
		o-		debug={0,1} ---  [Use this to see XML sent and received via middleware] ---  (none)
		o-		debuglevel={1,2,3} ---  [Use this to see specific XML debug levels sent and received via middleware.  Pass a list useing a ',' seperating each number] ---  (none)
		x-		customerid={100006} ---  [needed from the web] ---  (Need to know for max)
		--------------------------------------
		x-		code={see Code note}  ---  [Required from web]  ---  (Seen on Order Processin Screen under 1. SHIP)
		0-		price={}  ---  []  ---  ()
		--------------------------------------
		x-		s_city={Scottsdale}  ---  [Required from web]  ---  (Seen on Order Processin Screen under 1. SHIP)
		x-		s_state={AZ}  ---  [Required from web]  ---  (Seen on Order Processin Screen under 1. SHIP)
		x-		s_country={US}  ---  [Required from web]  ---  ()
		x-		s_zip={85257}  ---  [Required from web]  ---  (Seen on Order Processin Screen under 1. SHIP)
		--------------------------------------
		x-		array_parts= [partarray is any array built on the calling page]
		o-		array_systems= [systemarray is any array built on the calling page]
	>
OUTPUT PARAMS:
	To see a list of all variables this tag returns turn on debuging.  Then under
	result set under parser engine you can see a list of all avilable variables.
NOTES:
	Code note:
		F5  FEDEX 2-DAY AIR
		F7  FEDEX OVERNIGHT
		F1  FEDEX PRIORITY 
		BW BEST WAY
		UG UPS GROUND
Contact for CF side is: Cory Lamle  -- Lamle@Cory.net.  
---------------------------------------------------------------------------
MOD DATE:	-----  Monday, July 18, 2000 10:09:36 AM ----- CJL
 ===================================================== --->
<cfparam name="attributes.url" default="#application.xtiurl#">
<cfparam name="attributes.dtd" default="#application.xtidtd#">
<cfparam name="attributes.debug" default="false">
<cfparam name="attributes.debuglevel" default="1,2,3">
<cfparam name="attributes.customerid">
<cfparam name="attributes.source">
<!--- SHIPPING CODES --->
<cfparam name="attributes.code">
<cfparam name="attributes.price" default="">
<!--- SHIPPING INFORMATION --->
<cfparam name="attributes.city">
<cfparam name="attributes.state">
<cfparam name="attributes.zip">
<cfparam name="attributes.country">
<cfparam name="attributes.geo_code" default="">
<!--- ARRAY PARTS --->
<cfparam name="attributes.array_parts">
<cfparam name="attributes.array_systems" default="">

<cfscript>
cart = "";
subtotal = 0;
// Start with standalone parts
if  (isarray(attributes.array_parts) and arraylen(attributes.array_parts) GT 0) {
	indexcnt = arraylen(attributes.array_parts) + 1;
	for ( i=1; i lt indexcnt ; i=i+1) {
		// P04334 override weight attribute to NULL if it's not 0
		if (attributes.array_parts[i].weight EQ 0) {
				temp_weight = '<weight>#ucase(attributes.array_parts[i].weight)#</weight>';
				}
			else {
				temp_weight = '<weight></weight>';
				}
	
		cart = cart & '
		<line_item>
			<product>
				<product_code>#ucase(attributes.array_parts[i].product)#</product_code>
				<quantity>#ucase(attributes.array_parts[i].quantity)#</quantity>
				<price>#ucase(attributes.array_parts[i].price)#</price>
				<sub_line>#ucase(attributes.array_parts[i].sub_line)#</sub_line>
				<rsn_code_prc>#ucase(attributes.array_parts[i].price_reason)#</rsn_code_prc>
				#temp_weight#
			</product>
		</line_item>
	';
	}
}

// Now the systems 
if  (isarray(attributes.array_systems) and arraylen(attributes.array_systems)) {
	indexcnt1 = arraylen(attributes.array_systems) + 1;   //writeoutput(arraylen(attributes.array_systems));
	for (x=1; x lt indexcnt1; x=x+1) {
		// P04334 override weight attribute to NULL if it's not 0
		if (attributes.array_systems[x].weight EQ 0) {
			temp_weight = '<weight>#ucase(attributes.array_systems[x].weight)#</weight>';
			}
		else {
			temp_weight = '<weight></weight>';
			}
		
		cart = cart & '
		<line_item>
			<configuration>
				<quantity>#ucase(attributes.array_systems[x].quantity)#</quantity>
				<baseunit>
					<product_code>#ucase(attributes.array_systems[x].b_product)#</product_code>
					<price>#ucase(attributes.array_systems[x].price)#</price>
					<sub_line>#ucase(attributes.array_systems[x].sub_line)#</sub_line>
					<rsn_code_prc>#Trim(ucase(attributes.array_systems[x].price_reason))#</rsn_code_prc>
					#temp_weight#
				</baseunit>';
		indexcnt2 = arraylen(attributes.array_systems[x].subitem) + 1; 						//writeoutput(arraylen(attributes.array_systems[x].subitem));
		for (y=1; y lt indexcnt2;  y=y+1) {
			cart = cart & '
				<component>
					<product_code>#ucase(attributes.array_systems[x].subitem[y].product)#</product_code>
					<quantity>#ucase(attributes.array_systems[x].subitem[y].quantity)#</quantity>
					<price>#ucase(attributes.array_systems[x].subitem[y].price)#</price>
					<rsn_code_prc>#ucase(attributes.array_systems[x].subitem[y].price_reason)#</rsn_code_prc>
					<summary_display>#ucase(attributes.array_systems[x].subitem[y].ISS_SUMMARY_DISPLAY)#</summary_display>
				</component>';
		}
		cart = cart & '
			</configuration>
		</line_item>';
	}
}
// Now throw the entire xml string together... 
xml = 
'<!DOCTYPE copy SYSTEM "#attributes.dtd#">
<xtiinput>
	<inputheader>
		<actionset>
		<action>get_shpntax</action>
		</actionset>
	</inputheader>
	<inputdata>
	<customerid>#ucase(attributes.customerid)#</customerid>
	<source>#ucase(attributes.source)#</source>
	<shipping_codes>
		<method>
			<code>#ucase(attributes.code)#</code>
			<price>#ucase(attributes.price)#</price>
		</method>
	</shipping_codes>
	<shipping_addr>
		<city>#ucase(attributes.city)#</city>
		<state>#ucase(attributes.state)#</state>
		<zip>#ucase(attributes.zip)#</zip>
		<geo_code>#ucase(attributes.geo_code)#</geo_code>
		<country>#ucase(attributes.country)#</country>
	</shipping_addr>
	<shopping_cart>#cart#
	</shopping_cart>
	</inputdata>
</xtiinput>';
</cfscript>